SEVEN SEGMENT DISPLAY INTERFACING WITH 8051
Seven Segment displays are used in a number of systems to display the numeric and character information..
Synopsis

Seven Segment displays are used in a number of systems to display the numeric and character information. The seven segments can display one digit at a time. Thus the no. of segments used depends on the no. of digits in the number to be displayed. A seven segment consists of eight LEDs which are aligned in a manner so as to display digits from 0 to 9 and some letters when proper combination of LED is switched on.

Description

Seven Segments are available in two configurations.

1. Common Anode 

2. Common Cathode

The pin diagrams of two configurations are shown in fig 1. Mostly common anode seven segment display is used because the output current of the microcontroler is not sufficient enough to drive the LED’s, similar to the case of driving an LED. The pins a-g of the seven segments is connected to the GPIO Port of the microcontroler. The common pin of the seven segments is connected to Vcc in common anode configuration. The ‘h’ has not been used, which is the dot pin of the controller. In common anode configuration seven segments display works on negative logic, which means provide logic 0 to the corresponding pin to make an LED glow.



Figure 2 shows the two different connections of common anode and common cathode configuration. In common cathode configuration, segments have drawn the supply from microcontroller which working is vice versa of common anode configuration. Table below shows the hex values used to display the different digits.

H-Segment dot led is Enable Table. (Common anode configuration)


H-Segment dot led is Disable Table. (Common anode configuration)


H-Segment dot led is Enable Table. (Common cathode configuration)


H-Segment dot led is Disable Table. (Common cathode configuration)


Applications:

1.Microwave ovens

2.Calculators

3.Washing machines

4.Radios

5.Digital clocks etc.

Proteus design for Seven Segment interfacing with 8051


Orcad design for Seven Segment interfacing with 8051


Seven Segment interfacing with 8051

/*  Name     : main.c
 *  Purpose  : Source code for 7SEG-COMMON-ANODE Interfacing with AT89C52.
 *  Author   : Gemicates
 *  Date     : 2014-01-13
 *  Website  : www.gemicates.org
 *  Revision : None
 */
 
#include <REGX52.H>					       // header file for AT89c52 series
#define seg_port P2					       // GPIO direction register declaration

void delay(int msec)			                       //delay function declaration
{
	int i,j;
	for(i=0;i<msec;i++)
	for(j=0;j<1275;j++);
}

void main()						        //main function
{    
	seg_port = 0xFF;				        //Port 2 make as aoutput port
	while(1)
	{
		seg_port = 0xFE;			        // 'A' segment turn on
		delay(50);
		seg_port = 0xFD;			        // 'B' segment turn on
		delay(50);
		seg_port = 0xFB;				// 'C' segment turn on
		delay(50);
		seg_port = 0xF7;				// 'D' segment turn on
		delay(50);
		seg_port = 0xEF;				// 'E' segment turn on
		delay(50);
		seg_port = 0xDF;				// 'F' segment turn on
		delay(50);
		seg_port = 0xBF;				// 'G' segment turn on
		delay(50);
		seg_port = 0x7F;				// 'H' segment turn on
		delay(50);
		
		// Default 'H' segment turn OFF
		seg_port = 0x40;				// Display '0'
		delay(50);
		seg_port = 0x79;				// Display '1'
		delay(50);
		seg_port = 0x24;				// Display '2'
		delay(50);
		seg_port = 0x30;				// Display '3'
		delay(50);
		seg_port = 0x19;				// Display '4'
		delay(50);
		seg_port = 0x12;				// Display '5'
		delay(50);
		seg_port = 0x02;				// Display '6'
		delay(50);
		seg_port = 0x78;				// Display '7'
		delay(50);
		seg_port = 0x00;				// Display '8'
		delay(50);
		seg_port = 0x10;				// Display '9'
		delay(50);
		
		// Default 'H' segment turn ON
		seg_port = 0xC0;				// Display '0'
		delay(50);
		seg_port = 0xF9;				// Display '1'
		delay(50);
		seg_port = 0xA4;				// Display '2'
		delay(50);
		seg_port = 0xB0;				// Display '3'
		delay(50);
		seg_port = 0x99;				// Display '4'
		delay(50);
		seg_port = 0x92;				// Display '5'
		delay(50);
		seg_port = 0x82;				// Display '6'
		delay(50);
		seg_port = 0xF8;				// Display '7'
		delay(50);
		seg_port = 0x80;				// Display '8'
		delay(50);
		seg_port = 0x90;				// Display '9'
		delay(50);
	}
}
INTERFACING OF SEVEN SEGMENT DISPLAY WITH 8051

Error message here!

Show Error message here!


Forgot your password?

Error message here!

Send OTP

Error message here!

Show Error message here!


Lost your password? Please enter your email address. You will receive a password you Need.

Send Error message here!


Back to log-in

Close